<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pages extends CI_Controller {

	public function view($page = 'home')
	{
            if ( ! file_exists('application/views/pages/'.$page.'.php'))
            {
		// Whoops, we don't have a page for that!
		show_404();
            }
            $this->load->helper('url');
            $datah['baseurl'] = base_url();
            $bu = base_url();
	    $datam['buttons'] = array("Home" => "$bu", "News" => 'index.php/news', "Incidents" => "#", "Alerts" => "#", "Classifieds" => "#", "Admin" => "#");  
            $datam['mytitle'] = 'Welcome to Area Manager';
            $datam['Administration'] = array("Users", "Areas", "Area Groups", "Security", "Classifieds");
            $datam['Classifieds'] = array("New", "Edit", "Delete", "Approve", "Bill");
            
            $data['title'] = ucfirst($page); // Capitalize the first letter
	
            $this->load->view('templates/header', $datah);
            $this->load->view('menus/mainmenu', $datam);
            //$this->load->view('pages/home');
            //echo modules::run('localhost/Learnci/index.php/menu/home'); 
//            $this->load->library('menu','','my_menu' );
//            $this->my_menu->pagemenu->home;
            $this->load->view('templates/sidebar');
            $this->load->view('pages/'.$page, $data);
            
            $this->load->view('templates/footer', $data);
	}
}
?>
